<template>
  <div>
    <ele-dialog-table
      v-if="type == 1"
      :title="$i18n.t('mesSalesOrder.salesOrderQuery')"
      width="800px"
      :visible.sync="mesSalesOrderDialogVisible"
      :formConfig="mesSalesOrderSearchDialog"
      :column="mesSalesOrderDialogColumn"
      @getSelectData="getSelectBaseGoods"
      :getList="getMesSalesOrderList"
      :hasFooter="hasMesSalesOrderFooter"
    >
    </ele-dialog-table>
    <ele-dialog-table
      v-if="type == 2"
      :title="$t('mesSalesOrder.materialQuery')"
      width="800px"
      :visible.sync="baseGoodsDialogVisible2"
      :formConfig="baseGoodsSearchDialog2"
      :column="baseGoodsDialogColumn2"
      @getSelectData="getSelectBaseGoods"
      :getList="getBaseGoodsList"
      :hasFooter="hasBaseGoodsFooter"
    >
    </ele-dialog-table>
    <ele-dialog-table
      v-if="type == 3"
      :title="$i18n.t('mesSalesOrder.modelingQuery')"
      width="800px"
      :visible.sync="mesTechnologyDialogVisible"
      :formConfig="mesTechnologySearchDialog"
      :column="mesTechnologyDialogColumn"
      @getSelectData="getSelectBaseGoods"
      :getList="getMesTechnologyList"
      :hasFooter="hasMesTechnologyFooter"
    >
    </ele-dialog-table>

    <ele-dialog-table
      :title="$t('mesFqcTask.boxCodeQuery')"
      v-if="type == 4"
      width="800px"
      :visible.sync="visible"
      :formConfig="CaseCodeSearchDialog"
      :column="CaseCodeDialogColumn"
      @getSelectData="getSelectBaseGoods"
      :getList="getCaseCodeList"
      v-bind="$attrs"
      :hasFooter="hasMesSalesOrderFooter"
    >
    </ele-dialog-table>

    <ele-dialog-table
      :title="$t('mesFqcTask.boxCodeQuery')"
      v-if="type == 5"
      width="800px"
      :visible.sync="visible"
      :formConfig="CaseCodeSearchDialog"
      :column="CaseCodeDialogColumn"
      @getSelectData="getSelectBaseGoods"
      :getList="getCaseCodeList"
      v-bind="$attrs"
      :hasFooter="hasMesSalesOrderFooter"
    >
    </ele-dialog-table>
  </div>
</template>

<script>
import { mesSalesOrderDialog } from "./mixin"
import { baseGoodsDialog2 } from "./mixinGoods"
import { mesTechnologyDialog } from "./mixinTechnology"
import { CaseCode } from "./mixinBox"
export default {
  name: "mesProdOrder",
  mixins: [mesSalesOrderDialog, baseGoodsDialog2, mesTechnologyDialog, CaseCode],
  props: {
    // 1 销售订单查询, 2 "物料查询"  3 "工艺建模查询"
    type: { type: Number, default: 1, require: true }
  },
  data() {
    return {}
  },
  methods: {
    // 弹框表格，双击表格，或者点击确定 返回选中数据
    getSelectBaseGoods(data) {
      this.$emit("responseList", data)
    }
  }
}
</script>
